
<%@page import="comits.web.client.servlets.demo.*"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="d"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/sql" prefix="sql"%>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1" import="java.sql.*" errorPage=""%>
<!--<sql:setDataSource var="dataSource" driver="com.mysql.jdbc.Driver"
	url="jdbc:mysql://178.33.40.182:3306/comits_base" user="comits"
	password="AdiTheo" scope="session" />	-->
<sql:setDataSource var="dataSource" driver="com.mysql.jdbc.Driver"
	url="jdbc:mysql://localhost:3306/comits_base" user="root"
	password="admin" scope="session" />

<html>
<!-- DW6 -->
<head>
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<title>Comits Web Client - CAlCULE DU STOCK SECU</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="mm_entertainment.css" type="text/css" />
</head>
<body>
	<form action="SsServlet" method="post">
		<table width="100%" border="0" cellspacing="0" cellpadding="0"
			align="center" border=1 style="height: 654px;">

			<tr bgcolor="02021e">
				<td width="410" nowrap="nowrap"><img src="images/vin.jpg"
					width="400" height="140" border="0" style="width: 472px;" />
				</td>
				<td colspan="2" valign="center" nowrap="nowrap" id="logo"
					style="width: 250px;">OENOLOGISTICS</td>
			</tr>


			<tr>
				<td colspan="3" valign="top" style="width: 901px; height: 435px"><br />
					<table border="0" cellspacing="0" cellpadding="2" width="80%"
						align="center" border=1 style="width: 789px;">
						<tr>
							<td class="subHeader" align="center">CALCULE DU STOCK DE
								SECURITE</td>
						</tr>
						<tr>
							<td>&nbsp;</td>
						</tr>
						<tr>
							<td style="height: 479px; width: 809px"><sql:query
									var="queryresults1" dataSource="${dataSource}">
                                        select NumBtq from comits_base.boutique
                            </sql:query>
                             <%
 	                            int numboutique = (int) Integer.parseInt(request.getParameter("boutique"));
                             %> 
 <sql:query var="queryresults2" dataSource="${dataSource}">
                                   select NumPdt from comits_base.produit where NumPdt in select (NumPdt from 

comits_base.produitstocke where NumSite='<%=numboutique%>') 
                             </sql:query>



								<table align="center" width="650" cellpadding="5" border=1
									style="height: 367px; width: 705px">
									<tr>
										<td>BOUTIQUE:</td>
										<td><select name="boutique">
												<option value="numboutique" />boutique
												</option>
												<c:forEach var="row" items="${queryresults1.rows}"
													varStatus="status">
													<option value="<c:out value="${row.NumBtq}" />">
														<c:out value="${row.NumBtq}" />
													</option>
												</c:forEach>


										</select></td>
									</tr>
									<tr>
										<td>PRODUIT:</td>
										<td><select name="produit">
												<option value="numproduit"></option>produit
												<option></option>
												<c:forEach var="row" items="${queryresults2.rows}">
													<!--

varStatus="status"!-->
													<option value='<c:out value="${row.NumPdt}" />'>
														<c:out value="${row.NumPdt}"></c:out>
													</option>
												</c:forEach>




										</select>
										</td>
									</tr>
									<tr>
										<td style="height: 41px;">TAUX DE SERVICE:</td>
										<td style="width: 517px;"><select name="Taux"
											tabindex="1">
												<option value="tauxService"></option>tauxService
												<option value="50">50</option>
												<option value="60">60</option>
												<option value="70">70</option>
												<option value="80">80</option>
												<option value="90">90</option>
												<option value="95">95</option>
												<option value="96">96</option>
												<option value="97">97</option>
												<option value="98">98</option>
												<option value="99">99</option>

										</select></td>
									</tr>
									<tr>
										<td>NB MOIS:<br> <i>(Nombre de mois pris en
												compte dans le calcul)</i></td>
										<td><select name="nbMois">
												<option value="nbMois"></option>nbMois
												<option value="2">02</option>
												<option value="3">03</option>
												<option value="4">04</option>
												<option value="5">05</option>
												<option value="6">06</option>
												<option value="7">07</option>
												<option value="8">08</option>
												<option value="9">09</option>
												<option value="10">10</option>
												<option value="11">11</option>
												<option value="12">12</option>
										</select></td>
									</tr>
									<tr>
										<td align="right"><input type="submit" name="action"
											class="button" value="Calculer" /></td>
										<td><input name="resultat" type="text" size="30"
											style="width: 122px;" align="middle"> Bouteilles</td>
									</tr>
								</table>
							</td>
						</tr>
					</table>
				</td>
			</tr>
		</table>
		<br />
	</form>
</body>
</html>


